 #include <iostream>
#include <string>
using namespace std;

int main()
{
    std::string s1;
    std::string s;
    std::cin >> s;
    for (char c:s){
        if (c=='('){
                s1+=c;
            }
        if (c==')'){
            if (s1[s1.length()-1]=='('){
                s1.pop_back();
            }
        }
    }
    for (char c:s){
        if (c=='['){
                s1+=c;
            }
        if (c==']'){
            if (s1[s1.length()-1]=='['){
                s1.pop_back();
            }
        }
    }
    for (char c:s){
        if (c=='{'){
                s1+=c;
            }
        if (c=='}'){
            if (s1[s1.length()-1]=='{'){
                s1.pop_back();
            }
        }
    }
    if (s1.length()>0)
        {std::cout << "Неверная" << std::endl;}
    else
        {std::cout << "Верная" << std::endl;}
}
